#ifndef MESHLOADERFAC_H_
#define MESHLOADERFAC_H_

#include "MeshLoader.h"
#include "DXObjMeshLoader.h"
#include "DXSdkMeshLoader.h"
#include "ObjMeshLoader.h"
#include "DXUT.h"
#include "SDKmisc.h"

namespace Loader
{
    static class MeshLoaderFac
    {
    public:
        static MeshLoader* Create(ID3D10Device* pd3dDevice, const std::wstring strFilename)
        {
            MeshLoader* ret = NULL;
            std::wstring ex = strFilename.substr(strFilename.find_last_of('.')+1);
            if (!ex.compare(L"obj"))
            {
                ret = new DXObjMeshLoader();
                //ret = new ObjMeshLoader();
            }
            else if (!ex.compare(L"sdkmesh"))
            {
                ret = new DXSdkMeshLoader();
            }
            ret->Create(pd3dDevice, strFilename.c_str());
            return ret;
        };
    };

}


#endif  //MESHLOADERFAC_H_